<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    div:not(#app) {
      padding: 50px;
    }
    .box1{
      background-color: rgb(123, 167, 43);
    }
    .box2{
      background-color: rgb(55, 158, 172);
    }
    .box3{
      background-color: rgb(160, 51, 154);
    }
  </style>
</head>
<body>
  <div id="app">
    <div class="box1" @click="fn1()">
      <div class="box2" @click="fn2()">
        <div class="box3" @click="fn3($event, 3)"></div>
      </div>
    </div>
  </div>
  <script src="./vue.js"></script>
  <script>
      const vm = new Vue({
        // 绑定vm到 视图上， 定义vm控制视图的范围
        el: '#app',
        methods: {
          fn3(e, n){
            e.stopPropagation();
            console.log(n);
          },
          fn2(){
            console.log(2);
          },
          fn1(){
            console.log(1);
          }
        }
      })
    
      
  </script>
</body>
</html>